package com.hksj.lntm.controller;

import com.hksj.common.core.model.Rest;
import com.hksj.lntm.dto.LiquidNitrogenCockpitDTO;
import com.hksj.lntm.service.LiquidNitrogenCockpitService;
import com.hksj.lntm.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author fjt
 * @data 2024/11/12 9:37
 * @describe
 */
@Api(tags = "液氮罐监测——驾驶舱")
@RestController
@RequestMapping("/api/lntm/cockpit")
public class LiquidNitrogenCockpitController {


    @Autowired
    private LiquidNitrogenCockpitService liquidNitrogenCockpitService;


    @PostMapping("/queryAlarmList")
    @ApiOperation(value = "告警记录详情（最近7天）", notes = "告警次数趋势（最近7天）",response = LiquidNitrogenAlarmDeviceInfoVO.class)
    public Rest<List<LiquidNitrogenAlarmDeviceInfoVO>> queryAlarmList(@RequestBody LiquidNitrogenCockpitDTO dto){
        return Rest.ok(liquidNitrogenCockpitService.queryAlarmList(dto));
    }


    @PostMapping("/queryAlarmTrend")
    @ApiOperation(value = "温度告警次数趋势（最近7天）", notes = "温度告警次数趋势（最近7天）",response = LiquidNitrogenTemperatureAlarmNumTrendVO.class)
    public Rest<List<LiquidNitrogenTemperatureAlarmNumTrendVO>> queryAlarmTrend(@RequestBody LiquidNitrogenCockpitDTO dto){
        return Rest.ok(liquidNitrogenCockpitService.queryAlarmTrend(dto));
    }


    @PostMapping("/queryCurrentAlarmDevice")
    @ApiOperation(value = "查询当前报警设备信息", notes = "查询当前报警设备信息",response = LiquidNitrogenCurrentAlarmDeviceInfoVO.class)
    public Rest<LiquidNitrogenCurrentAlarmDeviceInfoVO> queryCurrentAlarmDevice(@RequestBody LiquidNitrogenCockpitDTO dto){
        return Rest.ok(liquidNitrogenCockpitService.queryCurrentAlarmDevice(dto));
    }


    @PostMapping("/deviceList")
    @ApiOperation(value = "驾驶舱设备列表", response = LiquidNitrogenDeviceVO.class)
    public Rest<List<LiquidNitrogenDeviceVO>> queryLiquidNitrogenDeviceList(@RequestBody LiquidNitrogenCockpitDTO dto){
        return Rest.ok(liquidNitrogenCockpitService.queryLiquidNitrogenDeviceList(dto));
    }


    @PostMapping("/queryUsage")
    @ApiOperation(value = "驾驶舱氮气消耗情况(最近7天)", response = LiquidNitrogenUsageVO.class)
    public Rest<List<LiquidNitrogenUsageVO>> queryUsage(@RequestBody LiquidNitrogenCockpitDTO dto){
        return Rest.ok(liquidNitrogenCockpitService.queryUsage(dto));
    }


}
